package org.hxzon.tapestry5.components.base;

import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.apache.tapestry5.corelib.base.AbstractField;

@SupportsInformalParameters
public abstract class AbstractFieldEx extends AbstractField {
    @Parameter(name = "title", defaultPrefix = BindingConstants.LITERAL)
    private String _title;

    //add by hxzon
    protected void writeTitle(MarkupWriter writer) {
        if (_title != null) {
            writer.element("span", "class", "title");
            writer.write(_title);
            writer.end();
            writer.writeRaw("<br />");
        }
    }
}
